
% get_src_det
% Christopher J. Whalen
% University of Illinois
% 07/01/04

% Purpose - obtain src and det files in cell array to be used to view src and det positions in
%            AFNI


function [src,det]=get_src_det(align_choice,src_file,det_file,xyz)


if align_choice == 1         % Creating Dummy Source File to view HSP data
        det = cell(0);
        src = cell(length(xyz),1);
        for i=1:length(xyz)
            src(i)=cellstr(strcat('Pt',num2str(i)));
        end
elseif (align_choice == 2) | (align_choice == 3) 
	% Obtaining SRC
	src = textread(src_file, '%s');
	src = sort(src);
	temp_row = 1;
	for row=1:(length(src)-1)               % Removing repetetive rows
      if strcmp(src(row), src(row+1))==1  
      else 
          temp_src(temp_row,:) = src(row, :);
          temp_row = temp_row + 1;
      end
	end
	temp_src(temp_row,:) = src(length(src));
	src = temp_src;
	clear temp_src;       
	% Obtaining DET
	det = importdata(det_file);
	det = sort(det);
end